void main(List<String> args) {
  Person p = Person(name: '张三', age: 20, gender: '男');
  p.eat();
  // p.sleep();
  
  Teacher t = Teacher(name: '李四', age: 30, gender: '男');
  t.eat();

  Student s = Student(name: '王五', age: 20, gender: '男');
  s.sleep();
  
}

class Person {
  String? name;
  int? age;
  String? gender;

  Person({this.name, this.age, this.gender});
  eat() {
    print('${this.name} is eating');
  }

  sleep() {
    print('${this.name} is sleeping');
  }
  
}
class Teacher extends Person {
  Teacher({String? name, int? age, String? gender}) :super(name: name, age: age, gender: gender);

  @override
  eat() {
    // TODO: implement eat
    super.eat();
    print('${this.name} is eating ${this.age} years old');
  }
}

class Student extends Person {
  Student({String? name, int? age, String? gender}) :super(name: name, age: age, gender: gender);

  @override
  sleep() {
    // TODO: implement sleep
    // 
    super.sleep();
    print('${this.name} is sleeping ${this.age} years old');
  }

}
